<!--
/**
 * [Namespace]_[Module]
 *
 * NOTICE OF LICENSE
 * 
 * [Namespace]_[Module] is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * [Namespace]_[Module] is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with [Namespace]_[Module]. If not, see <http://www.gnu.org/licenses/>.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade [Namespace]_[Module] to newer
 * versions in the future. If you wish to customize [Namespace]_[Module] for your
 * needs please refer to http://www.faett.net for more information.
 *
 * @category    [Namespace]
 * @package     [Namespace]_[Module]
 * @copyright   Copyright (c) 2009 <info@faett.net> - faett.net
 * @license     <http://www.gnu.org/licenses/> 
 * 			    GNU General Public License (GPL 3)
 * @link	    http://www.faett.net
 * @link	    http://www.techdivision.com
 */
-->
<h4><?php echo $this->__('Module List') ?></h4>
<?php
	/*
        This shows how to load specific fields from a record in the database.
        1) Note the load(15), this corresponds to saying "select * from table where table_id = 15"
        2) You can then just use the get(fieldname) to pull specific data from the table.
        3) If you have a field named news_id, then it becomes getNewsId, etc.
	*/
	/*
        $news = Mage::getModel('<module>/<module>')->load(15);
        echo $news->getNewsId();
        echo $news->getTitle();
       	echo $news->getContent();
        echo $news->getStatus();
	*/

	/*
		This shows an alternate way of loading datas from a record using the database the "Magento Way" (using blocks and controller).
		Uncomment blocks in /app/code/local/Namespace/Module/controllers/IndexController.php if you want to use it.
	*/
	/*
        $object = $this->get<Module>();
        echo 'id: '.$object['test_id'].'<br/>';
		echo 'title: '.$object['title'].'<br/>';
		echo 'content: '.$object['content'].'<br/>';
		echo 'status: '.$object['status'].'<br/>';
	*/                    
            
	/*
		This shows how to load multiple rows in a collection and save a change to them.
		1) The setPageSize function will load only 5 records per page and you can set the current Page with the setCurPage function.
		2) The $collection->walk('save') allows you to save everything in the collection after all changes have been made.
	*/
	/*
		$i = 0;
                
		$collection = Mage::getModel('<module>/<module>')->getCollection();
		$collection->setPageSize(5);
		$collection->setCurPage(2);
		$size = $collection->getSize();
		$cnt = count($collection);
		foreach ($collection as $item) {
			$i = $i+1;
			$item->setTitle($i);
			echo $item->getTitle();
		}

		$collection->walk('save');
	*/
                
	/*
		This shows how to load a single record and save a change.
		1) Note the setTitle, this corresponds to the table field name, title, and then you pass it the text to change.
		2) Call the save() function only on a single record.
	*/
	/*
		$object = Mage::getModel('<module>/<module>')->load(1);
		$object->setTitle('This is a changed title');
		$object->save();
	*/

?> 